import Vue from 'vue'
import Router from 'vue-router'
import Index from "../controller/Index";
import Editor from "../components/Layout/Editor";

import FormEditor from "../controller/Editor/EditorForm";          //编辑器
import FormTheme from "../controller/Editor/EditorTheme";          //主题
import Template from "../controller/Template";
import MyList from "../controller/Home/Project";                   //模板页面

import Create from "../controller/Create";                         //创建项目（场景）
import CreateForm from "../controller/Create/CreateForm";
import CreateScene from "../controller/Create/CreateScene";      //创建调查项目

import NotFound from "../components/Router/NotFound";

Vue.use(Router)

const routes =  [
    {
        path: '/',
        component: Index,
        children: [
            {
                path: '',
                component: MyList
            },
            {
                path: 'template',
                component: Template
            },
        ]
    },
    {
        path: '/create',
        component: Create,
        children: [
            {
                path: '',
                component: CreateScene
            },
            {
                path: '/',
                component: CreateScene
            },
            {
                path: 'form',
                component: CreateForm
            }
        ]
    }
    ,
    {
        path: '/editor',
        component: Editor,
        children: [
            {
                path: '',
                components: { default: FormEditor }
            },
            {
                path: 'theme',
                components: { default: FormTheme }
            },
            {
                path: 'setting',
                components: { default: FormEditor }
            }
        ]
    },
    { path: "*", component: NotFound }
];

export default new Router({
    routes,
    mode: 'history'
})